<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:rich="http://richfaces.org/rich"
   xmlns:a4j="http://richfaces.org/a4j"
   xmlns:gs="http://java.sun.com/jsf/composite/gs"	
   template="/WEB-INF/templates/default.xhtml">
	<ui:define name="menu">
		<ui:include src="/protected/user/menu.xhtml" >
			<ui:param name="activeMenu" value="direccion" />
			<ui:param name="activeSubMenu" value="pais" />
		</ui:include>		
	</ui:define>	
	<ui:define name="breadcrumb">
		<ui:include src="breadcrumbEdit.xhtml" />
	</ui:define>
	<ui:define name="content">
	    <h:form id="form-edit" styleClass="well form-horizontal"> 	
	    	<legend>#{messages.paisData}</legend>	 
	    	<fieldset>
	    		<div class="control-group #{rich:findComponent('pais-nombre').valid ? '' : 'error'}">
	    			<h:outputLabel value="#{messages.paisNombre}:"
	    				for="pais-nombre" 
	    				styleClass="control-label"/>
	    			<div class="controls">
    					<h:inputText id="pais-nombre" value="#{paisBean.entity.name}" />
    					<h:message for="pais-nombre" errorClass="help-inline"/>
	    			</div> 
	    		</div>	    		

	    		<div class="control-group #{rich:findComponent('codigo-iso').valid ? '' : 'error'}">
	    			<h:outputLabel value="#{messages.paisCodigISO}:"
	    				for="codigo-iso" 
	    				styleClass="control-label"/>
	    			<div class="controls">
						<h:selectOneMenu id="codigo-iso" 
				    		value="#{paisBean.entity.codigoISO}">
				    		<f:selectItem itemLabel="#{messages.ingresarValor}" noSelectionOption="true"/>	
				    		<f:selectItems value="#{enumRefereceBean.codigosISO}" />
				    		<f:ajax event="change" 
								execute="@this" />
							<rich:validator/>
				    	</h:selectOneMenu>	    			
    					<h:message for="codigo-iso" errorClass="help-inline"/>
	    			</div> 
	    		</div>
	    	</fieldset>

			<div class="form-actions">
				<gs:buttonOk bean="#{paisBean}"/>
				<gs:buttonCancel bean="#{paisBean}"/>
			</div>
	    </h:form>
	</ui:define>	
</ui:composition>
